package com.hmall.api.client;

import com.config.DefaultFeign;
import com.fallback.UserClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "user-service",fallbackFactory = UserClientFallback.class, configuration = DefaultFeign.class)//告诉SpringCloud这个接口是一个Feign客户端，要调用user-service服务
public interface UserClient {

    /**
     * 扣减余额
     * @param pw
     * @param amount
     */
    @PutMapping("/users/money/deduct")
    public void deductMoney(@RequestParam("pw") String pw, @RequestParam("amount") Integer amount);
}
